﻿<Application x:Class="TreeBuilder.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ctrl="clr-namespace:Elderos.Controls;assembly=Elderos.Controls"
             xmlns:cp="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
             Startup="Application_Startup"
             ShutdownMode="OnMainWindowClose">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Office2010/Blue.xaml" />
                <ResourceDictionary>
                    <Style TargetType="cp:ColorPicker">
                        <Setter Property="ShowAvailableColors" Value="False"/>
                        <Setter Property="ShowRecentColors" Value="True"/>
                    </Style>
                    <Style x:Key="ValidatableBoxStyle"
                           TargetType="ctrl:ValidatableTextBox">
                        <Setter Property="Background"
                                Value="White" />
                        <Style.Triggers>
                            <Trigger Property="IsIncorrectValue"
                                     Value="True">
                                <Setter Property="Background"
                                        Value="Red" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                    <Style TargetType="ContextMenu">
                        <Setter Property="SnapsToDevicePixels"
                                Value="True" />
                        <Setter Property="OverridesDefaultStyle"
                                Value="True" />
                        <Setter Property="Grid.IsSharedSizeScope"
                                Value="true" />
                        <Setter Property="HasDropShadow"
                                Value="True" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ContextMenu">
                                    <Border Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
                                            BorderBrush="{DynamicResource {x:Static SystemColors.MenuBrush}}"
                                            BorderThickness="15">
                                        <StackPanel MinWidth="150"
                                                    IsItemsHost="True"
                                                    KeyboardNavigation.DirectionalNavigation="Cycle" />
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                    <Style TargetType="MenuItem">
                        <Setter Property="HeaderTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <Grid MinWidth="150">
                                        <ContentPresenter Content="{Binding}" />
                                    </Grid>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
